/**
 * File: ReadEntryBean.java
 * Created by: mhaimel
 * Created on: 18 Aug 2009
 * CVS:  $Id: ReadEntryBean.java,v 1.1 2009/08/27 14:52:44 mhaimel Exp $
 */
package uk.ac.ebi.curtain.util.io;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import uk.ac.ebi.velvet.model.Strand;

/**
 * @author mhaimel
 *
 */
public class ReadEntryBean {
	
	private Integer fileId;
	private String id;
	private Strand strand;
	private Long localFilePos;
	
	public ReadEntryBean() {
	}

	public ReadEntryBean(Integer fileId, String id, Strand strand,
			Long localFilePos) {
		super();
		this.fileId = fileId;
		this.id = id;
		this.strand = strand;
		this.localFilePos = localFilePos;
	}

	public Integer getFileId() {
		return fileId;
	}

	public void setFileId(Integer fileId) {
		this.fileId = fileId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Strand getStrand() {
		return strand;
	}

	public void setStrand(Strand strand) {
		this.strand = strand;
	}

	public Long getLocalFilePos() {
		return localFilePos;
	}

	public void setLocalFilePos(Long localFilePos) {
		this.localFilePos = localFilePos;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((fileId == null) ? 0 : fileId.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((localFilePos == null) ? 0 : localFilePos.hashCode());
		result = prime * result + ((strand == null) ? 0 : strand.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ReadEntryBean other = (ReadEntryBean) obj;
		if (fileId == null) {
			if (other.fileId != null)
				return false;
		} else if (!fileId.equals(other.fileId))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (localFilePos == null) {
			if (other.localFilePos != null)
				return false;
		} else if (!localFilePos.equals(other.localFilePos))
			return false;
		if (strand == null) {
			if (other.strand != null)
				return false;
		} else if (!strand.equals(other.strand))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.SHORT_PREFIX_STYLE);
	}
}
